home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / othergnu / gnuplot.zoo / atari.diff next >
Encoding:
Text File  |  1992-07-03  |  25.5 KB  |  1,058 lines

  1. diff -crbB gnuplot.org\command.c d:\tc2\gnu\gnuplot\command.c
  2. *** gnuplot.org\command.c    Sat Feb 15 17:12:08 1992
  3. --- d:\tc2\gnu\gnuplot\command.c    Thu Feb 13 00:51:12 1992
  4. ***************
  5. *** 2871,2876 ****
  6. --- 2871,2879 ----
  7.   #ifdef AMIGA_AC_5
  8.   char strg0[256];
  9.   #endif
  10. + #if defined(ATARI)&&defined(__GNUC__)
  11. + #include <osbind.h>
  12. + #endif
  13.   
  14.   do_system()
  15.   {
  16. ***************
  17. *** 2881,2887 ****
  18. --- 2884,2903 ----
  19.      getparms(input_line+1,parms);
  20.      if(fexecv(parms[0],parms) < 0)
  21.   #else
  22. + #if defined(ATARI)&&defined(__GNUC__)
  23. +    /* use preloaded shell, if available */
  24. +    short (*shell_p)(char *command);
  25. +    void *ssp;
  26. +    ssp=(void*)Super(NULL);
  27. +    shell_p=*(short(**)(char*))0x4f6;
  28. +    Super(ssp);
  29. +    /* this is a bit strange, but we have to have a single if */
  30. +    if( (shell_p ? (*shell_p)(input_line+1) : system(input_line+1) ) )
  31. + #else
  32.      if (system(input_line + 1))
  33. + #endif
  34.   #endif
  35.         os_error("system() failed",NO_CARET);
  36.   }
  37. diff -crbB gnuplot.org\demo\simple.dem d:\tc2\gnu\gnuplot\demo\simple.dem
  38. *** gnuplot.org\demo\simple.dem    Tue Feb 11 23:19:22 1992
  39. --- d:\tc2\gnu\gnuplot\demo\simple.dem    Fri Feb 28 13:21:58 1992
  40. ***************
  41. *** 31,37 ****
  42.   plot [-30:20] sin(x*20)*atan(x)
  43.   pause -1 "Hit return to continue"
  44.   
  45. ! plot [-19:19] '1.dat'with impulses ,'2.dat' ,'3.dat' with lines
  46.   pause -1 "Hit return to continue"
  47.   
  48.   # undo what we have done above
  49. --- 31,37 ----
  50.   plot [-30:20] sin(x*20)*atan(x)
  51.   pause -1 "Hit return to continue"
  52.   
  53. ! plot [-19:19] '1.dat' with impulses ,'2.dat' ,'3.dat' with lines
  54.   pause -1 "Hit return to continue"
  55.   
  56.   # undo what we have done above
  57. diff -crbB gnuplot.org\internal.c d:\tc2\gnu\gnuplot\internal.c
  58. *** gnuplot.org\internal.c    Sat Feb 15 17:12:28 1992
  59. --- d:\tc2\gnu\gnuplot\internal.c    Sun Feb 09 17:01:00 1992
  60. ***************
  61. *** 66,77 ****
  62.   #ifdef apollo
  63.   int matherr(struct exception *x)    /* apollo */
  64.   #else /* apollo */
  65. ! #ifdef AMIGA_LC_5_1
  66.   int matherr(x)    /* AMIGA_LC_5_1 */
  67.   struct exception *x;
  68.   #else    /* Most everyone else (not apollo). */
  69.   int matherr()
  70. ! #endif /* AMIGA_LC_5_1 */
  71.   #endif /* apollo */
  72.   #endif /* MSDOS */
  73.   {
  74. --- 66,77 ----
  75.   #ifdef apollo
  76.   int matherr(struct exception *x)    /* apollo */
  77.   #else /* apollo */
  78. ! #if defined(AMIGA_LC_5_1)||defined(ATARI)&&defined(__GNUC__)
  79.   int matherr(x)    /* AMIGA_LC_5_1 */
  80.   struct exception *x;
  81.   #else    /* Most everyone else (not apollo). */
  82.   int matherr()
  83. ! #endif /* AMIGA_LC_5_1 || GCC_ST */
  84.   #endif /* apollo */
  85.   #endif /* MSDOS */
  86.   {
  87. diff -crbB gnuplot.org\plot.c d:\tc2\gnu\gnuplot\plot.c
  88. *** gnuplot.org\plot.c    Sat Feb 15 17:12:36 1992
  89. --- d:\tc2\gnu\gnuplot\plot.c    Sun Mar 08 17:54:16 1992
  90. ***************
  91. *** 57,62 ****
  92. --- 57,66 ----
  93.   #include <graphics.h>
  94.   #endif
  95.   
  96. + #if defined(__GNUC__)&&defined(ATARI)
  97. + #include <osbind.h>
  98. + #endif
  99.   extern char *getenv(),*strcat(),*strcpy(),*strncpy();
  100.   
  101.   extern char input_line[];
  102. ***************
  103. *** 134,165 ****
  104.   #define HOME "sys$login:"
  105.   
  106.   #else /* vms */
  107. ! #ifdef MSDOS
  108.   
  109.   #define HOME "GNUPLOT"
  110.   
  111. ! #else /* MSDOS */
  112. ! #if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
  113. ! #define HOME "GNUPLOT"
  114. ! #else /* AMIGA */
  115.   
  116.   #define HOME "HOME"
  117.   
  118. ! #endif /* AMIGA */
  119. ! #endif /* MSDOS */
  120.   #endif /* vms */
  121.   
  122. ! #ifdef unix
  123. ! #define PLOTRC ".gnuplot"
  124. ! #else /* unix */
  125. ! #if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
  126.   #define PLOTRC ".gnuplot"
  127. ! #else /* AMIGA */
  128.   #define PLOTRC "gnuplot.ini"
  129. ! #endif /* AMIGA */
  130. ! #endif /* unix */
  131.   
  132.   #ifdef __TURBOC__
  133.   void tc_interrupt()
  134. --- 138,159 ----
  135.   #define HOME "sys$login:"
  136.   
  137.   #else /* vms */
  138. ! #if defined(MSDOS) ||  defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1) || defined(ATARI)
  139.   
  140.   #define HOME "GNUPLOT"
  141.   
  142. ! #else /* MSDOS || AMIGA || ATARI */
  143.   
  144.   #define HOME "HOME"
  145.   
  146. ! #endif /* MSDOS || AMIGA || ATARI */
  147.   #endif /* vms */
  148.   
  149. ! #if defined(unix) || defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
  150.   #define PLOTRC ".gnuplot"
  151. ! #else /* AMIGA || unix */
  152.   #define PLOTRC "gnuplot.ini"
  153. ! #endif /* AMIGA || unix */
  154.   
  155.   #ifdef __TURBOC__
  156.   void tc_interrupt()
  157. ***************
  158. *** 297,302 ****
  159. --- 321,330 ----
  160.                   (void) signal(SIGINT, ss_interrupt);
  161.   #endif
  162.   #else /* MSDOS */
  163. + #if defined(__GNUC__)&&defined(ATARI)
  164. +         /* clear keybd buffer - strange GCC bug with signal(SIGINT) */
  165. +                 while( Cconis() ) Cnecin();
  166. + #endif /* GNUC && ATARI */
  167.                   (void) signal(SIGINT, inter);   /* go there on interrupt char */
  168.   #endif /* MSDOS */
  169.   }
  170. ***************
  171. *** 313,320 ****
  172.   #ifdef vms
  173.       (void) strcpy(home,HOME);
  174.   #else /* vms */
  175.   #if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
  176. -     strcpy(home,getenv(HOME));
  177.       {
  178.           int h;
  179.           h = strlen(home) - 1;
  180. --- 341,356 ----
  181.   #ifdef vms
  182.       (void) strcpy(home,HOME);
  183.   #else /* vms */
  184. + #if !defined(AMIGA_AC_5)&&!defined(AMIGA_LC_5_1)&&!defined(MSDOS)&&!defined(ATARI)
  185. +     (void) strcat(strcpy(home,getenv(HOME)),"/");
  186. + #else 
  187. +     char *tmp_home=getenv(HOME);
  188. +     if( !tmp_home ) {
  189. +         home[0]='\0';
  190. +     } else {
  191. +         strcpy(home,tmp_home);
  192.   #if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
  193.           {
  194.               int h;
  195.               h = strlen(home) - 1;
  196. ***************
  197. *** 326,334 ****
  198.              }
  199.       }
  200.   #else /* AMIGA */
  201. !     (void) strcat(strcpy(home,getenv(HOME)),"/");
  202.   #endif /* AMIGA */
  203.   #endif /* vms */
  204.   #ifdef NOCWDRC
  205.       /* inhibit check of init file in current directory for security reasons */
  206.       {
  207. --- 362,374 ----
  208.               }
  209.           }
  210.   #else /* AMIGA */
  211. !         if( strlen(home) && home[strlen(home)-1]!='\\' )
  212. !             strcat(home,"\\");
  213.   #endif /* AMIGA */
  214. +     }
  215. + #endif /* !AMIGA && !MSDOS && !ATARI */
  216.   #endif /* vms */
  217.   #ifdef NOCWDRC
  218.       /* inhibit check of init file in current directory for security reasons */
  219.       {
  220. diff -crbB gnuplot.org\plot.h d:\tc2\gnu\gnuplot\plot.h
  221. *** gnuplot.org\plot.h    Sat Feb 15 17:12:46 1992
  222. --- d:\tc2\gnu\gnuplot\plot.h    Mon Feb 10 23:07:40 1992
  223. ***************
  224. *** 39,45 ****
  225. --- 39,49 ----
  226.   #if defined(AMIGA_LC_5_1) || defined(AMIGA_AC_5)
  227.   #define SHELL "NewShell"
  228.   #else /* AMIGA */
  229. + #ifdef ATARI
  230. + #define SHELL "gulam.prg"
  231. + #else /* ATARI */
  232.   #define SHELL "/bin/sh"        /* used if SHELL env variable not set */
  233. + #endif /* ATARI */
  234.   #endif /* AMIGA  */
  235.   
  236.   #define SAMPLES 100        /* default number of samples for a plot */
  237. ***************
  238. *** 111,116 ****
  239. --- 115,124 ----
  240.   #endif
  241.   
  242.   
  243. + #ifdef ATARI
  244. + #define OS "TOS "
  245. + #endif
  246.   #ifndef OS
  247.   #define OS ""
  248.   #endif
  249. ***************
  250. *** 260,268 ****
  251. --- 268,278 ----
  252.       LEFT, CENTRE, RIGHT
  253.   };
  254.   
  255. + #if !(defined(ATARI)&&defined(__GNUC__)&&defined(_MATH_H)) /* FF's math.h has the type already */
  256.   struct cmplx {
  257.       double real, imag;
  258.   };
  259. + #endif
  260.   
  261.   
  262.   struct value {
  263. diff -crbB gnuplot.org\readline.c d:\tc2\gnu\gnuplot\readline.c
  264. *** gnuplot.org\readline.c    Sat Feb 15 17:12:54 1992
  265. --- d:\tc2\gnu\gnuplot\readline.c    Sun Feb 09 21:41:44 1992
  266. ***************
  267. *** 69,75 ****
  268.   #endif
  269.   
  270.   
  271. ! #ifndef MSDOS
  272.   
  273.   /* UNIX specific stuff */
  274.   #ifdef TERMIOS
  275. --- 69,75 ----
  276.   #endif
  277.   
  278.   
  279. ! #if !defined(MSDOS)&&!defined(ATARI)
  280.   
  281.   /* UNIX specific stuff */
  282.   #ifdef TERMIOS
  283. ***************
  284. *** 81,95 ****
  285.   #endif /* TERMIOS */
  286.   static int term_set = 0;    /* =1 if rl_termio set */
  287.   
  288. ! #else
  289.   /* MSDOS specific stuff */
  290.   #define getc(stdin) msdos_getch()
  291.   static char msdos_getch();
  292.   #endif /* MSDOS */
  293.   
  294.   /* is it <string.h> or <strings.h>?   just declare what we need */
  295.   extern int strlen();
  296.   extern char *strcpy();
  297. --- 81,101 ----
  298.   #endif /* TERMIOS */
  299.   static int term_set = 0;    /* =1 if rl_termio set */
  300.   
  301. ! #else /* !MSDOS && !ATARI */
  302. ! #ifdef MSDOS
  303.   /* MSDOS specific stuff */
  304.   #define getc(stdin) msdos_getch()
  305.   static char msdos_getch();
  306. ! #else /* MSDOS */
  307. ! /* ATARI then */
  308. ! #ifdef getc
  309. ! #undef getc
  310. ! #endif
  311. ! #define getc(f) tos_getch()
  312. ! static char tos_getch();
  313.   #endif /* MSDOS */
  314. + #endif /* !MSDOS && !ATARI */
  315.   
  316.   /* is it <string.h> or <strings.h>?   just declare what we need */
  317.   extern int strlen();
  318.   extern char *strcpy();
  319. ***************
  320. *** 494,504 ****
  321.   
  322.   #endif /* MSDOS */
  323.   
  324.   /* set termio so we can do our own input processing */
  325.   static void
  326.   set_termio()
  327.   {
  328. ! #ifndef MSDOS
  329.       if(term_set == 0) {
  330.   #ifdef TERMIOS
  331.   #ifdef TCGETS
  332. --- 500,561 ----
  333.   
  334.   #endif /* MSDOS */
  335.   
  336. + #ifdef ATARI
  337. + /* Convert Arrow keystrokes to Control characters: TOS version */
  338. + #include <osbind.h>
  339. + static char
  340. + tos_getch()
  341. + {
  342. +     long c=Cnecin();
  343. +     int scan_code=(int)(c>>16); /* get the scancode */
  344. +     scan_code &= 0xff;
  345. +     if( Kbshift(-1)&7 ) scan_code|=0x80; /* Shift or Ctrl */
  346. +     switch(scan_code) {
  347. +     case 0x48: /* Up Arrow */
  348. +         c=0x10; /* ^P */
  349. +         break;
  350. +     case 0x50: /* Down Arrow */
  351. +         c=0x0e; /* ^N */
  352. +         break;
  353. +     case 0x4b: /* Left Arrow */
  354. +         c=0x02; /* ^B */
  355. +         break;
  356. +     case 0x4d: /* Right Arrow */
  357. +         c=0x06; /* ^F */
  358. +         break;
  359. +     case 0xcb: /* Shift Left Arrow */
  360. +     case 0xf3: /* Ctrl Left Arrow (TOS-bug ?) */
  361. +         c=0x01; /* ^A */
  362. +         break;
  363. +     case 0xcd: /* Ctrl Right Arrow */
  364. +     case 0xf4: /* Ctrl Right Arrow (TOS-bug ?) */
  365. +         c=0x05; /* ^E */
  366. +         break;
  367. +     case 0x61: /* Undo - redraw line */
  368. +         c=0x0c; /* ^L */
  369. +         break;
  370. +     }
  371. +     if( (char)c==(char)0x1b ) c=0x15; /* Esc becomes ^U */
  372. +     if( (char)c==(char)0x7f ) c=0x04; /* Del becomes ^D */
  373. +     return (char)c;
  374. + }
  375. + #endif /* ATARI */
  376.   /* set termio so we can do our own input processing */
  377.   static void
  378.   set_termio()
  379.   {
  380. ! #if !defined(MSDOS)&&!defined(ATARI)
  381.       if(term_set == 0) {
  382.   #ifdef TERMIOS
  383.   #ifdef TCGETS
  384. ***************
  385. *** 538,550 ****
  386.   #endif /* TERMIOS */
  387.           term_set = 1;
  388.       }
  389. ! #endif /* MSDOS */
  390.   }
  391.   
  392.   static void
  393.   reset_termio()
  394.   {
  395. ! #ifndef MSDOS
  396.       if(term_set == 1) {
  397.   #ifdef TERMIOS
  398.   #ifdef TCSETSW
  399. --- 595,607 ----
  400.   #endif /* TERMIOS */
  401.           term_set = 1;
  402.       }
  403. ! #endif /* !MSDOS && !ATARI */
  404.   }
  405.   
  406.   static void
  407.   reset_termio()
  408.   {
  409. ! #if !defined(MSDOS)&&!defined(ATARI)
  410.       if(term_set == 1) {
  411.   #ifdef TERMIOS
  412.   #ifdef TCSETSW
  413. ***************
  414. *** 557,562 ****
  415.   #endif /* TERMIOS */
  416.           term_set = 0;
  417.       }
  418. ! #endif /* MSDOS */
  419.   }
  420.   #endif /* READLINE */
  421. --- 614,619 ----
  422.   #endif /* TERMIOS */
  423.           term_set = 0;
  424.       }
  425. ! #endif /* !MSDOS && !ATARI */
  426.   }
  427.   #endif /* READLINE */
  428. diff -crbB gnuplot.org\term\epson.trm d:\tc2\gnu\gnuplot\term\epson.trm
  429. *** gnuplot.org\term\epson.trm    Sat Feb 15 18:17:16 1992
  430. --- d:\tc2\gnu\gnuplot\term\epson.trm    Fri Mar 06 12:37:28 1992
  431. ***************
  432. *** 17,23 ****
  433.    * This file is included by ../term.c.
  434.    *
  435.    * This terminal driver supports:
  436. !  *  epson_lx800, nec_cp6c, nec_cp6d, nec_cp6b, starc,
  437.    *  epson_60dpi, tandy_60dpi
  438.    *
  439.    * AUTHORS
  440. --- 17,23 ----
  441.    * This file is included by ../term.c.
  442.    *
  443.    * This terminal driver supports:
  444. !  *  epson_lx800, nec_cp6, starc,
  445.    *  epson_60dpi, tandy_60dpi
  446.    *
  447.    * AUTHORS
  448. ***************
  449. *** 49,58 ****
  450.   
  451.   EPSONinit()
  452.   {
  453. ! #ifdef PC
  454. !     reopen_binary();
  455. ! #endif
  456. ! #ifdef vms
  457.       reopen_binary();
  458.   #endif
  459.   }
  460. --- 49,55 ----
  461.   
  462.   EPSONinit()
  463.   {
  464. ! #ifdef REOPEN_BINARY
  465.       reopen_binary();
  466.   #endif
  467.   }
  468. ***************
  469. *** 135,190 ****
  470.   static unsigned int neccolor[] = {1,8,4,2,10,12,6,14};
  471.   static unsigned int necpcolor[]= {0,2,1,4};
  472.   
  473. ! NECinit()
  474.   {
  475. ! #ifdef PC
  476. !     reopen_binary();
  477. ! #endif
  478. ! #ifdef vms
  479. !     reopen_binary();
  480. ! #endif
  481.   }
  482.   
  483. ! /* Monochrome only NEC CP6 printer (set term nec_cp6m or nec_cp6d). */
  484. ! /* will probably work with NEC P6 printer */
  485. ! NECMgraphics()
  486.   {
  487. !     b_charsize(FNT5X9);
  488. !     b_makebitmap((unsigned int)(NECXMAX*xsize),
  489. !                  (unsigned int)(NECYMAX*ysize),1);
  490.   }
  491.   
  492. ! /* Color ribbon in NEC CP6 printer (set term nec_cp6c) */
  493. ! NECCgraphics()
  494.   {
  495.       b_charsize(FNT5X9);
  496.       b_makebitmap((unsigned int)(NECXMAX*xsize),
  497. !                  (unsigned int)(NECYMAX*ysize),4);
  498. ! }
  499. ! NECdraft_text()
  500. ! {
  501. !     nec_draft_dump();
  502. !     b_freebitmap();
  503.   }
  504.   
  505.   NECtext()
  506.   {
  507.       nec_dump();
  508.       b_freebitmap();
  509.   }
  510.   
  511. ! NECClinetype(linetype)
  512.   int linetype;
  513.   {
  514.       if (linetype>=6)
  515.           linetype %= 6;
  516.       b_setvalue(neccolor[linetype+2]);
  517.   }
  518.   
  519. - #define NECMlinetype b_setlinetype
  520.   #define NECmove b_move
  521.   #define NECvector b_vector
  522.   #define NECput_text b_put_text
  523. --- 132,203 ----
  524.   static unsigned int neccolor[] = {1,8,4,2,10,12,6,14};
  525.   static unsigned int necpcolor[]= {0,2,1,4};
  526.   
  527. ! static int NECmode;
  528. ! NECoptions()
  529.   {
  530. !     if( END_OF_COMMAND ) {
  531. !         strcpy(term_options,"monochrome");
  532. !         NECmode='m';
  533. !     } else
  534. !     if( almost_equals(c_token,"m$onochrome") ) {
  535. !         c_token++;
  536. !         strcpy(term_options,"monochrome");
  537. !         NECmode='m';
  538. !     } else
  539. !     if( almost_equals(c_token,"c$olor") ) {
  540. !         c_token++;
  541. !         strcpy(term_options,"color");
  542. !         NECmode='c';
  543. !     } else
  544. !     if( almost_equals(c_token,"d$raft") ) {
  545. !         c_token++;
  546. !         strcpy(term_options,"draft");
  547. !         NECmode='d';
  548. !     } else {
  549. !     /* error, but since the terminal is already set, default to mono */
  550. !         strcpy(term_options,"monochrome");
  551. !         NECmode='m';
  552. !         int_error("modes: color, monochrome, draft",c_token);
  553. !     }
  554.   }
  555.   
  556. ! NECinit()
  557.   {
  558. ! #ifdef REOPEN_BINARY
  559. !     reopen_binary();
  560. ! #endif
  561.   }
  562.   
  563. ! NECgraphics()
  564.   {
  565.       b_charsize(FNT5X9);
  566.       b_makebitmap((unsigned int)(NECXMAX*xsize),
  567. !              (unsigned int)(NECYMAX*ysize),(NECmode=='c' ? 4 : 1));
  568.   }
  569.   
  570.   NECtext()
  571.   {
  572. +     if( NECmode=='d' ) {
  573. +         nec_draft_dump();
  574. +     } else {
  575.           nec_dump();
  576. +     }
  577.       b_freebitmap();
  578.   }
  579.   
  580. ! NEClinetype(linetype)
  581.   int linetype;
  582.   {
  583. +     if( NECmode=='c' ) {
  584.           if (linetype>=6)
  585.               linetype %= 6;
  586.           b_setvalue(neccolor[linetype+2]);
  587. +     } else {
  588. +         b_setlinetype(linetype);
  589. +     }
  590.   }
  591.   
  592.   #define NECmove b_move
  593.   #define NECvector b_vector
  594.   #define NECput_text b_put_text
  595. ***************
  596. *** 325,334 ****
  597.   
  598.   STARCinit()
  599.   {
  600. ! #ifdef PC
  601. !     reopen_binary();
  602. ! #endif
  603. ! #ifdef vms
  604.       reopen_binary();
  605.   #endif
  606.   }
  607. --- 338,344 ----
  608.   
  609.   STARCinit()
  610.   {
  611. ! #ifdef REOPEN_BINARY
  612.       reopen_binary();
  613.   #endif
  614.   }
  615. diff -crbB gnuplot.org\term\hpgl.trm d:\tc2\gnu\gnuplot\term\hpgl.trm
  616. *** gnuplot.org\term\hpgl.trm    Tue Feb 11 23:25:02 1992
  617. --- d:\tc2\gnu\gnuplot\term\hpgl.trm    Thu Mar 05 19:39:42 1992
  618. ***************
  619. *** 48,64 ****
  620.   */
  621.   }
  622.   
  623. ! HPLJIII_PORT_init()
  624. ! {
  625. !       fputs("\033E\033&l1X\033&l0O\033%0B;PW0.15\n",outfile);
  626. ! }
  627.   
  628. ! HPLJIII_LAND_init()
  629.   {
  630. !     fputs("\033E\033&l1X\033&l1O\033%0B;PW0.15\n",outfile);
  631.   }
  632.   
  633.   HPLJIII_graphics()
  634.   {
  635.       fprintf(outfile,
  636. --- 48,82 ----
  637.   */
  638.   }
  639.   
  640. ! static char HPLJIIImode;
  641.   
  642. ! HPLJIII_options()
  643.   {
  644. !     if( END_OF_COMMAND ) {
  645. !         term_options[0]='\0';
  646. !         HPLJIIImode='0';
  647. !     } else
  648. !     if( almost_equals(c_token,"p$ortrait") ) {
  649. !         c_token++;
  650. !         strcpy(term_options,"portrait");
  651. !         HPLJIIImode='0';
  652. !     } else
  653. !     if( almost_equals(c_token,"l$andscape") ) {
  654. !         c_token++;
  655. !         strcpy(term_options,"landscape");
  656. !         HPLJIIImode='1';
  657. !     } else {
  658. !         term_options[0]='\0';
  659. !         HPLJIIImode='0';
  660. !         int_error("portrait or landscape",c_token);
  661. !     }
  662. ! }
  663. ! HPLJIII_init()
  664. ! {
  665. !     fprintf(outfile,"\033E\033&l1X\033&l%cO\033%0B;PW0.15\n",HPLJIIImode);
  666.   }
  667.   
  668.   HPLJIII_graphics()
  669.   {
  670.       fprintf(outfile,
  671. diff -crbB gnuplot.org\term\hpljii.trm d:\tc2\gnu\gnuplot\term\hpljii.trm
  672. *** gnuplot.org\term\hpljii.trm    Sat Feb 15 18:19:28 1992
  673. --- d:\tc2\gnu\gnuplot\term\hpljii.trm    Fri Mar 06 12:37:52 1992
  674. ***************
  675. *** 78,89 ****
  676.   HPLJIIoptions()
  677.   {
  678.   char opt[4];
  679.   
  680. ! #define HPDJERROR "expecting dots per inch size 75, 100, 150 or 300"
  681. !     if (!END_OF_COMMAND) {
  682. !         if (token[c_token].length>3)
  683. !             int_error(HPDJERROR,c_token);
  684.           /* almost_equals() won't accept numbers - use strcmp() instead */
  685.           capture(opt,c_token,c_token);
  686.           if (!strcmp(opt,"75")) {
  687. --- 78,91 ----
  688.   HPLJIIoptions()
  689.   {
  690.   char opt[4];
  691. + int parse_error=0;
  692.   
  693. !     if (END_OF_COMMAND) {
  694. !         term_options[0]='\0';
  695. !     } else {
  696. !         if (token[c_token].length>3) {
  697. !             parse_error=1; /* see below */
  698. !         } else {
  699.           /* almost_equals() won't accept numbers - use strcmp() instead */
  700.               capture(opt,c_token,c_token);
  701.               if (!strcmp(opt,"75")) {
  702. ***************
  703. *** 98,107 ****
  704.           else if (!strcmp(opt,"300")) {
  705.                  hplj_dpp = 1;
  706.           } else {
  707. !             int_error(HPDJERROR,c_token);
  708.           }
  709.           c_token++;
  710.       }
  711.   
  712.       term_tbl[term].xmax = HPLJII_XMAX;
  713.       term_tbl[term].ymax = HPLJII_YMAX;
  714. --- 100,111 ----
  715.               else if (!strcmp(opt,"300")) {
  716.                   hplj_dpp = 1;
  717.               } else {
  718. !         /* error, but set dpi anyway, since term it already set */
  719. !                 parse_error=1;
  720.               }
  721.           c_token++;
  722.           }
  723. +     }
  724.   
  725.       term_tbl[term].xmax = HPLJII_XMAX;
  726.       term_tbl[term].ymax = HPLJII_YMAX;
  727. ***************
  728. *** 127,141 ****
  729.               term_tbl[term].h_tic = 5;
  730.               break;
  731.       }
  732.   }
  733.   
  734.   
  735.   HPLJIIinit()
  736.   {
  737. ! #ifdef vms
  738. !    reopen_binary();
  739. ! #endif /* vms */
  740. ! #ifdef PC
  741.      reopen_binary();
  742.   #endif /* PC */
  743.   }
  744. --- 131,146 ----
  745.               term_tbl[term].h_tic = 5;
  746.               break;
  747.       }
  748. +     if( parse_error ) 
  749. +         int_error("expecting dots per inch size 75, 100, 150 or 300",
  750. +                 c_token);
  751.   }
  752.   
  753.   
  754.   HPLJIIinit()
  755.   {
  756. ! #ifdef REOPEN_BINARY
  757.      reopen_binary();
  758.   #endif /* PC */
  759.   }
  760. diff -crbB gnuplot.org\term.c d:\tc2\gnu\gnuplot\term.c
  761. *** gnuplot.org\term.c    Sat Feb 15 17:13:18 1992
  762. --- d:\tc2\gnu\gnuplot\term.c    Fri Mar 06 12:36:28 1992
  763. ***************
  764. *** 43,50 ****
  765. --- 43,55 ----
  766.   /* for use by all drivers */
  767.   #define sign(x) ((x) >= 0 ? 1 : -1)
  768.   #define abs(x) ((x) >= 0 ? (x) : -(x))
  769. + #ifndef max    /* GCC uses inline functions */
  770.   #define max(a,b) ((a) > (b) ? (a) : (b))
  771. + #endif
  772. + #ifndef min
  773.   #define min(a,b) ((a) < (b) ? (a) : (b))
  774. + #endif
  775.   
  776.   BOOLEAN term_init;            /* true if terminal has been initialized */
  777.   
  778. ***************
  779. *** 75,82 ****
  780.   #ifdef __TURBOC__
  781.   char *turboc_init();
  782.   #endif
  783. ! #ifdef PC
  784.   void reopen_binary();
  785.   #endif
  786.   #ifdef vms
  787.   char *vms_init();
  788. --- 80,89 ----
  789.   #ifdef __TURBOC__
  790.   char *turboc_init();
  791.   #endif
  792. ! #if defined(PC)||defined(ATARI)
  793.   void reopen_binary();
  794. + #define REOPEN_BINARY
  795.   #endif
  796.   #ifdef vms
  797.   char *vms_init();
  798. ***************
  799. *** 87,92 ****
  800. --- 94,100 ----
  801.   void term_nopasthru();
  802.   void reopen_binary();
  803.   void fflush_binary();
  804. + #define REOPEN_BINARY
  805.   #endif
  806.   
  807.   /* This is needed because the unixplot library only writes to stdout. */
  808. ***************
  809. *** 428,433 ****
  810. --- 436,444 ----
  811.   #include "term/amiga.trm"
  812.   #endif
  813.   
  814. + #ifdef ATARI
  815. + #include "term/atari.trm"
  816. + #endif
  817.   
  818.   /* Dummy functions for unavailable features */
  819.   
  820. ***************
  821. *** 492,497 ****
  822. --- 503,517 ----
  823.          AMIGA_justify_text, do_point, do_arrow}
  824.   #endif
  825.   
  826. + #ifdef ATARI
  827. +     ,{"atari", "Atari ST/TT",
  828. +        ATARI_XMAX, ATARI_YMAX, ATARI_VCHAR, ATARI_HCHAR, 
  829. +        ATARI_VTIC, ATARI_HTIC, ATARI_options, ATARI_init, ATARI_reset, 
  830. +        ATARI_text, null_scale, ATARI_graphics, ATARI_move, ATARI_vector, 
  831. +        ATARI_linetype, ATARI_put_text, ATARI_text_angle, 
  832. +        null_justify_text, ATARI_point, do_arrow}
  833. + #endif
  834.   #ifdef DUMB
  835.       ,{"dumb", "printer or glass dumb terminal",
  836.        DUMB_XMAX, DUMB_YMAX, 1, 1,
  837. ***************
  838. *** 812,826 ****
  839.   #endif
  840.   
  841.   #ifdef HPLJIII
  842. !     ,{"pcl5_port", "HP laserjet iii (using HPGL plot vectors), portrait mode",
  843. !     HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
  844. !     HPGL_VTIC, HPGL_HTIC, options_null, HPLJIII_PORT_init, HPLJIII_reset,
  845. !     HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
  846. !     HPGL_linetype, HPGL_put_text, HPGL_text_angle,
  847. !     null_justify_text, do_point, do_arrow}
  848. !      ,{"pcl5_land", "HP laserjet iii (using HPGL plot vectors), landscape mode",
  849.       HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
  850. !     HPGL_VTIC, HPGL_HTIC, options_null, HPLJIII_LAND_init, HPLJIII_reset,
  851.       HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
  852.       HPGL_linetype, HPGL_put_text, HPGL_text_angle,
  853.       null_justify_text, do_point, do_arrow}
  854. --- 832,840 ----
  855.   #endif
  856.   
  857.   #ifdef HPLJIII
  858. !     ,{"pcl5", "HP laserjet iii (using HPGL plot vectors) [port land]",
  859.       HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
  860. !     HPGL_VTIC, HPGL_HTIC, HPLJIII_options, HPLJIII_init, HPLJIII_reset,
  861.       HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
  862.       HPGL_linetype, HPGL_put_text, HPGL_text_angle,
  863.       null_justify_text, do_point, do_arrow}
  864. ***************
  865. *** 878,900 ****
  866.   #endif
  867.   
  868.   #ifdef NEC
  869. !     ,{"nec_cp6m", "NEC printer CP6, Epson LQ-800 Monochrome",
  870. !        NECXMAX, NECYMAX, NECVCHAR, NECHCHAR, 
  871. !        NECVTIC, NECHTIC, options_null, NECinit, NECreset, 
  872. !        NECtext, null_scale, NECMgraphics, NECmove, NECvector, 
  873. !        NECMlinetype, NECput_text, NEC_text_angle, 
  874. !        null_justify_text, line_and_point, do_arrow}
  875. !     ,{"nec_cp6c", "NEC printer CP6 Color",
  876. !        NECXMAX, NECYMAX, NECVCHAR, NECHCHAR, 
  877. !        NECVTIC, NECHTIC, options_null, NECinit, NECreset, 
  878. !        NECtext, null_scale, NECCgraphics, NECmove, NECvector, 
  879. !        NECClinetype, NECput_text, NEC_text_angle, 
  880. !        null_justify_text, do_point, do_arrow}
  881. !     ,{"nec_cp6d", "NEC printer CP6, Epson LQ-800 Draft monochrome",
  882.          NECXMAX, NECYMAX, NECVCHAR, NECHCHAR, 
  883. !        NECVTIC, NECHTIC, options_null, NECinit, NECreset, 
  884. !        NECdraft_text, null_scale, NECMgraphics, NECmove, NECvector, 
  885. !        NECMlinetype, NECput_text, NEC_text_angle, 
  886.          null_justify_text, line_and_point, do_arrow}
  887.   #endif
  888.   
  889. --- 892,902 ----
  890.   #endif
  891.   
  892.   #ifdef NEC
  893. !     ,{"nec_cp6", "NEC printer CP6, Epson LQ-800 [monocrome color draft]",
  894.          NECXMAX, NECYMAX, NECVCHAR, NECHCHAR, 
  895. !        NECVTIC, NECHTIC, NECoptions, NECinit, NECreset, 
  896. !        NECtext, null_scale, NECgraphics, NECmove, NECvector, 
  897. !        NEClinetype, NECput_text, NEC_text_angle, 
  898.          null_justify_text, line_and_point, do_arrow}
  899.   #endif
  900.   
  901. ***************
  902. *** 1198,1203 ****
  903. --- 1200,1209 ----
  904.          term_name = "amiga";
  905.   #endif
  906.   
  907. + #ifdef ATARI
  908. +        term_name = "atari";
  909. + #endif
  910.   #ifdef UNIXPC
  911.          if (iswind() == 0) {
  912.             term_name = "unixpc";
  913. ***************
  914. *** 1446,1453 ****
  915.       (*t->text)();
  916.   }
  917.   
  918. ! #ifdef PC
  919.   /* output for some terminal types must be binary to stop non Unix computers
  920.      changing \n to \r\n. 
  921.      If the output is not STDOUT, the following code reopens outfile 
  922. --- 1452,1458 ----
  923.       (*t->text)();
  924.   }
  925.   
  926. ! #if defined(PC)||defined(ATARI)
  927.   /* output for some terminal types must be binary to stop non Unix computers
  928.      changing \n to \r\n. 
  929.      If the output is not STDOUT, the following code reopens outfile 
  930. ***************
  931. *** 1473,1479 ****
  932.           }
  933.       }
  934.   }
  935. ! #endif
  936.   
  937.   #ifdef vms
  938.   /* these are needed to modify terminal characteristics */
  939. --- 1478,1484 ----
  940.           }
  941.       }
  942.   }
  943. ! #endif /* PC || ATARI */
  944.   
  945.   #ifdef vms
  946.   /* these are needed to modify terminal characteristics */
  947. diff -crbB gnuplot.org\term.h d:\tc2\gnu\gnuplot\term.h
  948. *** gnuplot.org\term.h    Sat Feb 15 17:13:30 1992
  949. --- d:\tc2\gnu\gnuplot\term.h    Thu Mar 05 15:58:58 1992
  950. ***************
  951. *** 45,51 ****
  952.   
  953.   /* These terminals are not relevant for MSDOS */
  954.   #ifndef MSDOS
  955.   #ifdef AMIGA_LC_5_1
  956.   #define AMIGASCREEN    /* Amiga custom screen */
  957.   
  958. --- 45,51 ----
  959.   
  960.   /* These terminals are not relevant for MSDOS */
  961.   #ifndef MSDOS
  962. ! #ifndef ATARI
  963.   #ifdef AMIGA_LC_5_1
  964.   #define AMIGASCREEN     /* Amiga custom screen */
  965.   
  966. ***************
  967. *** 78,91 ****
  968.   #define HP26        /* HP2623A and maybe others */
  969.   #define HP75        /* HP7580, and probably other HPs */
  970.   #define IMAGEN      /* Imagen laser printers (300dpi) (requires -Iterm also) */
  971. - #define NEC        /* NEC CP6 pinwriter printer */
  972.   #define PRESCRIBE    /* Kyocera Laser printer */
  973.   #define QMS        /* QMS/QUIC laserprinter (Talaris 1200 and others) */
  974. - #define STARC        /* Star Color Printer */
  975.   #define TANDY60        /* Tandy DMP-130 series 60-dot per inch graphics */
  976.   #define V384        /* Vectrix 384 and tandy color printer */
  977.   
  978.   #endif /* MSDOS */
  979.   
  980.   /* These terminals can be used on any system */
  981. --- 77,92 ----
  982.   #define HP26            /* HP2623A and maybe others */
  983.   #define HP75            /* HP7580, and probably other HPs */
  984.   #define IMAGEN          /* Imagen laser printers (300dpi) (requires -Iterm also) */
  985.   #define PRESCRIBE       /* Kyocera Laser printer */
  986.   #define QMS             /* QMS/QUIC laserprinter (Talaris 1200 and others) */
  987.   #define TANDY60         /* Tandy DMP-130 series 60-dot per inch graphics */
  988.   #define V384            /* Vectrix 384 and tandy color printer */
  989.   
  990. + #endif /* ATARI */
  991. + #define NEC             /* NEC CP6 pinwriter printer */
  992. + #define STARC           /* Star Color Printer */
  993.   #endif /* MSDOS */
  994.   
  995.   /* These terminals can be used on any system */
  996. diff -crbB gnuplot.org\version.c d:\tc2\gnu\gnuplot\version.c
  997. *** gnuplot.org\version.c    Sat Feb 15 17:13:36 1992
  998. --- d:\tc2\gnu\gnuplot\version.c    Sat Feb 15 17:53:02 1992
  999. ***************
  1000. *** 35,42 ****
  1001.    */
  1002.   
  1003.   char version[] = "3.0 ";
  1004. ! char patchlevel[] = "1, Dec 1 91";
  1005. ! char date[] = "Sun Dec 1 16:56:36 1991";
  1006.   
  1007.   /* override in Makefile */
  1008.   #ifndef CONTACT
  1009. --- 35,42 ----
  1010.    */
  1011.   
  1012.   char version[] = "3.0 ";
  1013. ! char patchlevel[] = "1a, Mar 10 92";
  1014. ! char date[] = "Tue Mar 10 22:00:00 1992";
  1015.   
  1016.   /* override in Makefile */
  1017.   #ifndef CONTACT
  1018.  
  1019.